import { createApp } from 'vue'
import { globalRegister } from '@/global/index'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import './assets/css/index.less'
import App from './App.vue'
import router from './router'
import store, { setupStore } from './store'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
// 当点击刷新按钮时，调用函数派发action获取本地token...-Mutation设置到vuex。因为当点击刷新按钮时候vuex中的数据就会被情空，所以需要从新在本地取出来保存到vuex中,此处可以返回一个函数，也可以直接调用
setupStore()
createApp(App)
  .use(globalRegister)
  .use(store)
  .use(router)
  .use(ElementPlus, {
    locale: zhCn
  })
  .mount('#app')
